import Router from 'koa-router';
import { authMiddleware } from '../../middleware/auth';
import { ApiResponse } from '../../types';

const router = new Router({ prefix: '/api/config' });

// 获取配置列表
router.get('/', async (ctx) => {
  ctx.body = {
    success: true,
    data: [],
    message: '配置列表功能待实现'
  } as ApiResponse;
});

// 获取热门配置
router.get('/hot', async (ctx) => {
  ctx.body = {
    success: true,
    data: [],
    message: '热门配置功能待实现'
  } as ApiResponse;
});

// 获取推荐配置
router.get('/featured', async (ctx) => {
  ctx.body = {
    success: true,
    data: [],
    message: '推荐配置功能待实现'
  } as ApiResponse;
});

// 获取配置详情
router.get('/:id', async (ctx) => {
  const { id } = ctx.params;
  ctx.body = {
    success: true,
    data: { id },
    message: '配置详情功能待实现'
  } as ApiResponse;
});

// 创建配置（需要认证）
router.post('/', authMiddleware, async (ctx) => {
  ctx.body = {
    success: true,
    message: '创建配置功能待实现'
  } as ApiResponse;
});

// 更新配置
router.put('/:id', authMiddleware, async (ctx) => {
  const { id } = ctx.params;
  ctx.body = {
    success: true,
    data: { id },
    message: '更新配置功能待实现'
  } as ApiResponse;
});

// 删除配置
router.delete('/:id', authMiddleware, async (ctx) => {
  const { id } = ctx.params;
  ctx.body = {
    success: true,
    message: '删除配置功能待实现'
  } as ApiResponse;
});

export default router; 